<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body></body>
  <script>
    /* 

    */
    //    let obj = {name:'zs',age:18}
    //    function fn(a={name:'撒黑色'}){
    //     console.log(a,'a');
    //    }
    //    fn()
    let obj = {name:'zs'}
    //  函数每次调用，都会重新创建默认值,  如果默认值是一个声明的变量值，则公用一个对象。
    let fn = function (a = { name: "沙和尚" }) {
        console.log(a.name);
      a.name = "汤神";
      console.log(a.name,);
    };
    fn()
    fn()
  </script>
</html>
